/*
package org.kfive.nova.web.controllers;

*/
/*
 * Copyright (c) 2016 lizhanwu.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *//*


import org.kelex.prome.rpc.ThriftClient;
import org.kelex.prome.support.rpc.OAuthMessage;
import org.kelex.prome.support.rpc.ProjectStub;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;

*/
/*
 * <p>
 * TestController.java
 *
 * Application:
 * NO
 *
 * Limited:
 * NO
 *
 * Warning:
 * NO
 *-----------------------------------------------------------------------------
 *         VERSION       DATE            BY       CHANGE/COMMENT
 * -----------------------------------------------------------------------------
 *          1.0      2016-8-1215:31     lizhanwu      create
 * -----------------------------------------------------------------------------
 * </p>
 *//*

@Controller
@RequestMapping("/test")
public class TestController {

    @RequestMapping(value = "/data",method = RequestMethod.GET)
//    public void data(@MatrixVariable String q, HttpServletRequest request){
    public void data(HttpServletRequest request, HttpServletResponse response){

        ProjectStub stub = new ProjectStub("04BAA5B5DFCC073BD09BAFBD8135BBB4"
                , "www.cube.com:8090"
//                , "www.cube.com"
                , "B4E7A26026A93E9227B518C192359889"
                , "luomeng"
                , 45
                , "192.168.89.221");

        ThriftClient client = new ThriftClient("192.168.89.254", 20034, 10000);
        try {
            client.open();
            long start=System.currentTimeMillis();
            OAuthMessage oauth = client.oauth(stub, null);
            PrintWriter writer = response.getWriter();
            writer.print(System.currentTimeMillis()-start);
            this.hashCode();
        } catch (Exception e) {
            e.printStackTrace();
        }finally {
            client.close();
        }
    }

}
*/
